import React, { FC, memo } from 'react';
import { HandleOrder, OrderOptions } from '@/types/OrderOptions';
import OrderDropDownBase from '@/components/order-dropdown/Base';

const minerOrderOptions: OrderOptions[] = [
  {
    text: '主币总算力',
    value: 'hash',
  },
  {
    text: '矿机名  ',
    value: 'name',
  },
  {
    text: '最高温度 ',
    value: 'hottest',
  },
  {
    text: '显卡数  ',
    value: 'card',
  },
  {
    text: 'IP地址 ',
    value: 'ip',
  },
  {
    text: '互联网连接',
    value: 'internet',
  },
  {
    text: '拒绝率  ',
    value: 'reject',
  },
];

interface IMinerOrderDropDownProps {
  handleOrder?: HandleOrder;
}

const MinerOrderDropDown: FC<IMinerOrderDropDownProps> = (props) => {
  const { handleOrder } = props;

  return (
    <OrderDropDownBase
      defaultOrderKey="hash"
      handleOrder={handleOrder}
      orderOptions={minerOrderOptions}
    />
  );
};

export default memo(MinerOrderDropDown);
